package geeorm

import (
	"database/sql"
	_ "github.com/mattn/go-sqlite3"
	"log"
)

func main() {
	db,_:=sql.Open("sqlite3","gee.db")
	defer func() {_=db.Close()}()
	db.Exec("DROP TABLE IF EXISTS User;")
	db.Exec("CREATE TABLE User(Name text);")
	result,err:=db.Exec("INSERT INTO User(`Name`) VALUES (?),(?)","Tom","Sam")
	if err==nil{
		affected,_:=result.RowsAffected()
		log.Println(affected)
	}
	row:=db.QueryRow("SELECT Name FROM User LIMIT 1")
	var name string
	if err:=row.Scan(&name);err==nil{
		log.Println(name)
	}
}